package com.zwd.deep.mapper;

import com.zwd.deep.entity.po.Appointments;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 预约时间表 Mapper 接口
 * </p>
 *
 * @author zwd
 * @since 2025-02-12
 */
@Mapper
public interface AppointmentsMapper extends BaseMapper<Appointments> {

    @Select("select * from appointments where doctor_id = #{doctorId} and appointment_date BETWEEN #{startDate} AND #{endDate}")
    List<Appointments> check(String doctorId, LocalDate startDate, LocalDate endDate);

    @Select("select * from appointments where appointment_date_time = #{localDateTime} and doctor_id = #{doctorId}")
    Appointments selectIs(LocalDateTime localDateTime, String doctorId);
}
